package net.trade.common;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

public class TradeUtils {
	/**
	 * ajax返回字符串
	 * @param response
	 * @param str
	 */
	public static void ajaxStr(HttpServletResponse response,String str){
		PrintWriter pw = null;
		try {
			response.setContentType("text/text;charset=UTF-8");
			response.setHeader("Cache-Control", "no-cache");
			pw = response.getWriter();
			pw.write(str);
		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			if(pw != null){
				pw.close();
			}
		}
	}
}
